
<template>
  <div>
    <video id="videoElement" controls autoplay muted width="300px" height="200px"></video>

    <!-- <button @click="play">播放</button> -->
  </div>
</template>

<script>
import flvjs from 'flv.js'
import HlsVideo from '@/components/_Hlsvideo/Hlsvideo'

export default {
  data() {
    return {
      flvPlayer: null,
    }
  },
  mounted() {
    if (flvjs.isSupported()) {
      var videoElement = document.getElementById('videoElement')
      this.flvPlayer = flvjs.createPlayer({
        type: 'flv',
        isLive: true,
        hasAudio: false,
        url: 'http://1011.hlsplay.aodianyun.com/demo/game.flv',
      })
      this.flvPlayer.attachMediaElement(videoElement)
      this.flvPlayer.load()
      this.flvPlayer.play()
    }
  },
  methods: {
    play() {
      this.flvPlayer.play()
    },
  },
}
</script>
<style lang="less" >
.justCont {
  .gutter-box {
    min-height: 220px;
    border: 1px solid rgba(228, 228, 228, 1);
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    cursor: pointer;
  }
  .ant-col-6 {
    margin-top: 20px;
  }
}
</style>

